package com.teaphy.readlist.controller;

import com.teaphy.readlist.model.MyException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author teaphy
 * @desc
 * @since 20:38
 */
@RestController
public class ExceptionController {

    @GetMapping("/testException")
    public Object testException() {
        int a = 1 / 0;
        return "Hello moc";
    }

    @GetMapping("/testMyException")
    public Object testMyException() {
        throw new MyException("10010", "test MyException");
    }
}
